package cn.pms.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import cn.pms.po.Employee;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@ParentPackage("myPackage")
@Namespace(value = "/sign")
public class SignAction extends ActionSupport
{
	private static final long serialVersionUID = 7251051079822235237L;
	private String msg = null;
	private Boolean canSign = false;
	
	@Action(value = "goToSign", results = {@Result(name = SUCCESS, location = "/sign/sign.jsp")})
	public String goToSign()
	{
		Employee emp = (Employee) ActionContext.getContext().getSession()
				.get("emp");
		canSign = emp.getEmpState().canSign();
		msg = emp.getEmpState().getValue();
		return SUCCESS;
	}
	
	public String getMsg()
	{
		return msg;
	}
	
	public Boolean getCanSign()
	{
		return canSign;
	}
}
